home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Copland ResourcesLib
/
System8Resources.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-01
|
4KB
|
106 lines
/*
File: System8Resources.h
Contains: The System 7 resource manager redefined in
terms of the System 8 Resource Manager.
Version: 1.0
Copyright: ©1995 Apple Computer. All Rights Reserved.
*/
#ifndef __SYS8RESOURCES__
#define __SYS8RESOURCES__
#include <Resources.h>
#if (!SystemEightOrLater)
typedef short ResFileRefNum;
typedef short ResID;
typedef short ResAttributes;
typedef short ResFileAttributes;
enum {
kResFileReadOnlyPermission = 100,
kResFileReadWriteExclusivePermission = 101
};
typedef UInt32 ResFilePermissions;
// * these can't be supported under the System 7 resource manager
// without hacks which may not work under the System 7.5.3 res manager.
//extern OSStatus RMRemoveResFileFromSearchPath(ResFileRefNum refNum);
//extern OSStatus RMAddResFileToSearchPath(ResFileRefNum refNum);
// *these functions can't be supported without some emulation
// of the Scarecrow filesystem, which I'm reluctant to do
// without being paid. I've create FileSpec-using equivalents,
// below.
//extern OSStatus RMCreateResFile(FSObjectSpecification *specification);
//extern OSStatus RMOpenResFile(FSObjectSpecification *specification, ResFilePermissions permissions, Boolean resLoad, ResFileRefNum *refNum);
#ifdef __cplusplus
extern "C" {
#endif
// * these two are __not__ part of the System 8 Resource Manager - see above
extern OSStatus RMFSpCreateResFile(FSSpec *inSpec, OSType creator, OSType fileType, ScriptCode scriptTag);
extern OSStatus RMFSpOpenResFile(FSSpec *specification, ResFilePermissions permissions, Boolean resLoad, ResFileRefNum *refNum);
extern OSStatus RMCloseResFile(ResFileRefNum refNum);
extern OSStatus RMUpdateResFile(ResFileRefNum refNum);
extern OSStatus RMUseResFile(ResFileRefNum refNum);
extern OSStatus RMCurResFile(ResFileRefNum *refNum);
extern OSStatus RMHomeResFile(Handle theResource, ResFileRefNum *refNum);
extern OSStatus RMAddResource(Handle theData, ResType theType, ResID theID, ConstStr255Param name);
extern OSStatus RMRemoveResource(Handle theResource);
extern OSStatus RMCountTypes(Boolean oneDeep, UInt32 *count);
extern OSStatus RMGetIndexedType(UInt32 index, Boolean oneDeep, ResType *theType);
extern OSStatus RMCountResources(ResType theType, Boolean oneDeep, UInt32 *count);
extern OSStatus RMGetIndexedResource(ResType theType, UInt32 index, Boolean oneDeep, Boolean resLoad, Handle *handle);
extern OSStatus RMGetResource(ResType theType, ResID theID, Boolean oneDeep, Boolean resLoad, Handle *handle);
extern OSStatus RMGetNamedResource(ResType theType, ConstStr255Param name, Boolean oneDeep, Boolean resLoad, Handle *handle);
extern OSStatus RMLoadResource(Handle theResource);
extern OSStatus RMReleaseResource(Handle theResource);
extern OSStatus RMDetachResource(Handle theResource);
extern OSStatus RMChangedResource(Handle theResource);
extern OSStatus RMWriteResource(Handle theResource);
extern OSStatus RMSetResourceSize(Handle theResource, SInt32 newSize);
extern OSStatus RMUniqueID(ResType theType, Boolean oneDeep, ResID *idPtr);
extern OSStatus RMGetResAttributes(Handle theResource, ResAttributes *attributes);
// * System 7 SetResInfo doesn't support setting the type of
// resources, so we don't here either.
extern OSStatus RMGetResInfo(Handle theResource, ResType *typePtr, ResID *idPtr, Str255 name);
extern OSStatus RMSetResInfo(Handle theResource, ResType /* theType */, ResID theID, ConstStr255Param name);
extern OSStatus RMSetResAttributes(Handle theResource, ResAttributes attrs);
extern OSStatus RMReadPartialResource(Handle theResource, UInt32 offset, void *buffer, UInt32 count);
extern OSStatus RMWritePartialResource(Handle theResource, UInt32 offset, const void *buffer, UInt32 count);
extern OSStatus RMGetResourceSize(Handle theResource, SInt32 *size);
extern OSStatus RMSetResErrProc(ResErrUPP proc);
extern OSStatus RMSetResFileReadOnlyState(ResFileRefNum refNum, Boolean isReadOnly);
extern OSStatus RMGetResFileReadOnlyState(ResFileRefNum refNum, Boolean *isReadOnly);
#ifdef __cplusplus
}
#endif
#endif
#endif //__SYS8RESOURCES__